package com.fortune.cat.Exception;

import org.springframework.http.HttpStatus;

/**
 * @author zhaozeyang
 * @date 2019/4/17 14:51
 * @description
 */
public abstract class CustomizeException extends RuntimeException {

    protected Integer status;

    protected HttpStatus httpStatus;

    public CustomizeException(Integer status, HttpStatus httpStatus, String message, Throwable cause) {
        super(message, cause);
        this.httpStatus = httpStatus;
        this.status = status;
    }

    public CustomizeException(String message, Integer status, HttpStatus httpStatus) {
        super(message);
        this.status = status;
        this.httpStatus = httpStatus;
    }

    public CustomizeException(String message) {
        super(message);
    }

    public CustomizeException(String message, Throwable cause) {
        super(message, cause);
    }

    public static CustomizeException createCustomizeException(HttpStatus HttpStatus, Integer status, String msg) {
        return new CustomizeException(msg, status, HttpStatus) {
        };
    }
}
